package spe.ui.editor.figure;

import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.PolygonDecoration;
import org.eclipse.draw2d.geometry.Insets;
import org.eclipse.draw2d.geometry.Rectangle;

public class TestCircleDecoration extends PolygonDecoration 
{

	@Override
	public void setRotation(final double angle) 
	{	}

	@Override
	protected void outlineShape(final Graphics g) 
	{
		Rectangle ovalBounds = getBounds().getCopy();
	    //ovalBounds.shrink(new Insets(1));
		Rectangle r = new Rectangle();
		r.setX(ovalBounds.x - 5);
		r.setY(ovalBounds.y - 5);
		r.setWidth(ovalBounds.width + 10);
		r.setHeight(ovalBounds.height + 10);
		r.shrink(new Insets(1));
	    //g.drawOval(ovalBounds);
		g.drawOval(r);
	}

	@Override
	protected void fillShape(final Graphics g) 
	{
		Rectangle ovalBounds = getBounds().getCopy();
		
		Rectangle r = new Rectangle();
		r.setX(ovalBounds.x - 5);
		r.setY(ovalBounds.y - 5);
		r.setWidth(ovalBounds.width + 10);
		r.setHeight(ovalBounds.height + 10);
		r.shrink(new Insets(1));
	    //ovalBounds.shrink(new Insets(1));
	    //g.fillOval(ovalBounds);
		g.drawOval(r);
	}
}
